home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / networking / 1117 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  6.5 KB

  1. Path: shellx.best.com!usenet
  2. From: Remi Lenoir <remi@dvsystems.com>
  3. Newsgroups: comp.sys.amiga.networking
  4. Subject: Re: trying to kludge an lp
  5. Date: Sun, 04 Feb 1996 21:38:03 -0800
  6. Organization: Digital Video Systems
  7. Message-ID: <311597BB.3019@dvsystems.com>
  8. References: <DM2sBF.9su@muse.calarts.edu> <31122BFD.2030@gbar.dtu.dk> <19960204.73EFD40.9B22@ragtime.vnet.net>
  9. NNTP-Posting-Host: pepper.vip.best.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (Win95; I)
  14.  
  15. John Kelly wrote:
  16. >  Rask Ingemann Lambertsen <gc948374@gbar.dtu.dk> writes:
  17. > > >         The best thing I can think of is to intercept stuff on it's way
  18. > > > to PRT: and remote copy (rcp) it to the prt: device of the node that has
  19. > > > the printer.  Is there a way to do this?  anyone have better ideas?
  20. > >
  21. > > Try the CMD command that comes with your WB, it can intercept output to
  22. > > serial or parallel devices and redirect it to a file.
  23. >  Or lpd.lha, which is a line printer daemon for AmiTCP, and does exactly
  24. >  what he wants.
  25. >   comm/tcp/   on any Aminet site.
  26.  
  27. This will be the first step: make the printer available to the network. But then, how to
  28. *transparently* print from the Amiga applications ?
  29.  
  30. To my knowledge there is no DOS handler or device driver to print with AmiTCP or AS225.
  31. It would be nice to have a NETPRT: device to which we could copy files. It would also be
  32. nice to have a PRT:/printer.device redirector to NETPRT: as well as one that would allow
  33. the files to be automatically processed -by a user specified program- just before they 
  34. get sent to the network (processed by 'a2p' for example...).
  35.  
  36. I personaly do not have the first problem as on our network the printer is made available
  37. by the server (SUN station). But, as john suggests, you could try lpd.lha to make the
  38. printer available to your network.
  39.  
  40. As for the second problem, I wrote an AREXX script for Final Writer that do the following:
  41.     1 - Captures the data sent by FW using CMD.
  42.     2 - Copy the data to the my account on the SUN server (accessible through NFS).
  43.     3 - Issue a "lpr" on the SUN ("rsh lpr filename")
  44.     4 - Delete the file from my account on the SUN.
  45.  
  46. It works ok but is not perfect because of bugs/limitations in FW1's AREXX interface.
  47.  
  48. Also, there is a lpr client that I use when printing text/postscript files from the SHELL.
  49. It is called port-lpr and is available on Aminet in comm/tcp as port-lpr.lha.
  50.  
  51. I have included the two AREXX scripts. Feel free to modify them to suit your needs.
  52. The two scripts are called from the user menu in FW. "NetPrint" print all the pages from
  53. the current section one by one. "NetPrint.All" attemps to print all the pages from all
  54. the sections but it doesn't work if I remember correctly (I didn't use those scripts for
  55. sometime).
  56.  
  57. Regards,
  58.  
  59.  -Remi.
  60.  
  61.  
  62. ----------------------------------- NetPrint ----------------------------------------
  63.  
  64. /***************************************************************/
  65. /*                                                             */
  66. /*                        BigNetPrint                          */
  67. /*                                                             */
  68. /* A FinalWriter Arexx macro to print on a NetWorked Printer   */
  69. /*                                                             */
  70. /* It uses the CMD program (SYS:Tools/CMD) to redirect the     */
  71. /* output to RAM:, then copy the file to the networked server  */
  72. /* and ask the server to print it.                             */
  73. /*                                                             */
  74. /* This is a modified version of NetPrint. The difference is   */
  75. /* that large document are printed page by page in order to    */
  76. /* keep the output files size in a reasonable proportion.      */
  77. /* Large files are a problem for at least two reasons:         */
  78. /*   - Use a lot of RAM or Disk space                          */
  79. /*   - Will cause you trouble with Unix spooler that will not  */
  80. /*     want to duplicate the file in its spool area because    */
  81. /*     it is too big (you'll have to ask him to use directly   */
  82. /*     the file on your account)                               */
  83. /* As a consequence, this method parallelizes the printing     */
  84. /* process (While FinalWriter outputs a page, the printer      */
  85. /* server prints a previous one) thus speeding the printing.   */
  86. /*                                                             */
  87. /* Author: Remi Lenoir                                         */
  88. /* Created: June 20, 1994                                      */
  89. /*                                                             */
  90. /***************************************************************/
  91.  
  92. OPTIONS results
  93.  
  94. /* These lines left just as examples */
  95. /*
  96. toto=4
  97. i=5
  98. PRINTSETUP Pages range frompage i topage i
  99. SHOWMESSAGE 1 1 '"toto = 'toto'" "" "" "OK" "" ""'
  100. EXIT
  101. */
  102.  
  103. /* Print the document page by page */
  104. STATUS Pages
  105. NbrPage=result
  106. DO i=1 TO NbrPage
  107.  
  108.   /*
  109.     Start 'CMD'.
  110.     If it is already running then we can not print because we need to choose
  111.     the output file name as we have to use copy it to the network.
  112.   */
  113.   IF SHOW(ports,'cas_TMP_CMD_PORT') THEN DO
  114.     SHOWMESSAGE 1 1 '"CMD already running, Can not print!" "" "" "OK" "" ""'
  115.     EXIT 5
  116.   END
  117.   ADDRESS COMMAND 'Run SYS:Tools/CMD parallel RAM:FinalWriter.prt'
  118.   ADDRESS COMMAND 'SYS:rexxc/WaitForPort cas_TMP_CMD_PORT'
  119.   IF (rc = 5) THEN DO
  120.     SHOWMESSAGE 1 1 '"Can t start SYS:Tools/CMD !" "" "" "OK" "" ""'
  121.     EXIT 5
  122.   END
  123.  
  124.   /*
  125.     Tell FinalWriter we want to print in range mode
  126.   */
  127.   PRINTSETUP Pages range frompage i topage i
  128.  
  129.   /*
  130.     Print page i
  131.   */
  132.   PRINT
  133.  
  134.   /*
  135.     Copy the file to my SparcStation account
  136.   */
  137.   ADDRESS COMMAND 'Copy RAM:FinalWriter.prt Sparc:'
  138.  
  139.   /*
  140.     Delete the file from RAM:
  141.   */
  142.   ADDRESS COMMAND 'Delete RAM:FinalWriter.prt'
  143.  
  144.   /*
  145.     Ask the SparcStation to print the file
  146.   */
  147.   ADDRESS COMMAND 'rsh dvs lpr -h FinalWriter.prt'
  148.  
  149.   /*
  150.     Delete the file from my account
  151.     (We can delete the file safely as Unix made a copy in its spool area)
  152.     Note: if the file is too big, Unix will NOT make a copy and will print
  153.           it directly. I do not handle that case, shame on me.
  154.   */
  155.   ADDRESS COMMAND 'Delete Sparc:FinalWriter.prt'
  156.  
  157. END
  158.  
  159.  
  160. -------------------------------- NetPrint.All ----------------------------------
  161.  
  162. /* Print All the section from the current document */
  163. OPTIONS results
  164.  
  165. /*ADDRESS FinalW.1*/
  166.  
  167. GetSectionList ','
  168. SectionList = Result
  169.  
  170. DO WHILE SectionList ~= ''
  171.   PARSE VAR SectionList SectionName ',' SectionList
  172.   CALL NetPrint_test(SectionName)
  173. END
  174.  
  175. EXIT 0
  176.